﻿using System.Modules.Contracts.DTO;
using System.Modules.SharePoint.Contracts.Attributes;

namespace System.Modules.SharePoint.Contracts.DTO
{
    /// <summary>
    /// SPWorkflowTaskActivityProperties
    /// </summary>
    public class SPWorkflowTaskActivityProperties
    {
        /// <summary>
        /// FieldNames
        /// </summary>
        public enum FieldNames
        {
            /// <summary>
            /// PercentComplete
            /// </summary>
            PercentComplete,
            /// <summary>
            /// AssignedTo
            /// </summary>
            AssignedTo,
            /// <summary>
            /// StartDate
            /// </summary>
            StartDate,
            /// <summary>
            /// DueDate
            /// </summary>
            DueDate,
            /// <summary>
            /// Description
            /// </summary>
            Body,
            /// <summary>
            /// WorkflowItemId
            /// </summary>
            WorkflowItemId
        }

        /// <summary>
        /// ID
        /// </summary>
        public Updatable<int> ID { get; set; }
        /// <summary>
        /// Title
        /// </summary>
        public Updatable<string> Title { get; set; }
        /// <summary>
        /// PercentComplete
        /// </summary>
        public Updatable<float> PercentComplete { get; set; }
        /// <summary>
        /// AssignedTo
        /// </summary>
        public Updatable<string> AssignedTo { get; set; }
        /// <summary>
        /// StartDate
        /// </summary>
        public Updatable<DateTime> StartDate { get; set; }
        /// <summary>
        /// DueDate
        /// </summary>
        public Updatable<DateTime> DueDate { get; set; }
        /// <summary>
        /// Description
        /// </summary>
        [BindingSPField("Body")]
        public Updatable<string> Description { get; set; }
        /// <summary>
        /// WorkflowItemId
        /// </summary>
        public Updatable<int> WorkflowItemId { get; set; }
    }

    /// <summary>
    /// Task List Item with T Extended
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class SPWorkflowTaskActivityProperties<T> : SPWorkflowTaskActivityProperties where T : new()
    {
        #region Constructor
        /// <summary>
        /// Default Constructor
        /// </summary>
        public SPWorkflowTaskActivityProperties() { Extended = new T(); }
        #endregion

        #region Properties
        /// <summary>
        /// Extended Properties
        /// </summary>
        public Updatable<T> Extended { get; set; }
        #endregion
    }
}